
$().ready(function(e) {
	var actions = $('#toolBar ul.actionBtn');
	var frm = $('#contentArea form');
		
	actions.find('li.back').click(function(){history.back()});   
	
	actions.find('li.saveclose').click(function(){
		$('button[value="save"]').click();
	});   
	actions.find('li.savenew').click(function(){
		$('button[value="add"]').click();
	});
	actions.find('li.save').click(function(){
		$('button[value="edit"]').click();
	});  
	//ENABLE DISABLE
	actions.find('li.enable').click(function(){
		$obj = $('button[value="enable"]');
		$cbx = $('form input.checkGroup:checked');
		var data = [];
		$cbx.each(function(i,value){
			data.push($cbx.eq(i).val());
		});
		$.ajax({
				url:$obj.attr('data-ajax'),
				data:{data:data},
				type:'POST',
				success:function(){
					location.reload();
				}
		});
	}); 
	actions.find('li.disable').click(function(){
		$obj = $('button[value="enable"]');
		$cbx = $('form input.checkGroup:checked');
		var data = [];
		$cbx.each(function(i,value){
			data.push($cbx.eq(i).val());
		});
		$.ajax({
				url:$obj.attr('data-ajax'),
				data:{data:data,status:0},
				type:'POST',
				success:function(){
					location.reload();
				}
		});
	});   
	
	
	//load lang
	
});
